package com.ylxn.sqlSession;

import com.ylxn.pojo.Configuration;
import com.ylxn.pojo.MappedStatement;

import java.sql.SQLException;
import java.util.List;

public interface Executor {
    /**
     * 查询方法
     * @param configuration 数据源对象
     * @param mappedStatement mappedStatement对象
     * @param params 参数
     * @param <E>
     * @return
     */
    public <E> List<E> query(Configuration configuration, MappedStatement mappedStatement, Object...params) throws SQLException;

    /**
     * 新增方法
     * @param configuration
     * @param mappedStatement
     * @param params
     * @return
     */
    public int save(Configuration configuration, MappedStatement mappedStatement, Object...params) throws SQLException, NoSuchFieldException, IllegalAccessException;

    /**
     * 更新方法
     * @param configuration
     * @param mappedStatement
     * @param params
     * @return
     */
    public int update(Configuration configuration, MappedStatement mappedStatement, Object...params) throws SQLException, NoSuchFieldException, IllegalAccessException;

    /**
     * s删除
     * @param configuration
     * @param mappedStatement
     * @param params
     * @return
     */
    public int delete(Configuration configuration, MappedStatement mappedStatement, Object...params) throws SQLException, NoSuchFieldException, IllegalAccessException;


}
